import { Define, EntityObjectFactory } from 'tiny-entity2';
import { OrganizationTree } from './organizationTree';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: "organization" })
export class Organization extends EntityObjectType<Organization>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    name: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    phone: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    createTime: number;

    /**
     * 法人代表姓名
     *
     * @type {string}
     * @memberof Organization
     */
    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    legalName: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    province: string;


    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    city: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    area: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    address: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    businessLicenseUrl: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
    })
    code: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    orgCodeUrl: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    logo: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    status: string;

    @Define.Column({
        DataType: Define.DataType.BOOL
    })
    isDelete: boolean;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    modifyTime: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
    })
    creditCode: string;

    orgTree: OrganizationTree;
}

export const OrganizationStauts = {
    Disable: 'disable'
}

